using NodeCanvas.Variables;
using UnityEngine;

namespace NodeCanvas.Actions
{
	[Name("Set IK")]
	[EventListener(new string[] { "OnAnimatorIK" })]
	public class MecanimSetIK : MecanimActions
	{
		public AvatarIKGoal IKGoal;

		[RequiredField]
		public BBGameObject goal;

		public BBFloat weight;

		protected override string info
		{
			get
			{
				return string.Concat("Set '", IKGoal, "' ", goal);
			}
		}

		public void OnAnimatorIK()
		{
			base.animator.SetIKPositionWeight(IKGoal, weight.value);
			base.animator.SetIKPosition(IKGoal, goal.value.transform.position);
			EndAction();
		}
	}
}
